#pragma once

#include "Test.h"
#include "phy/ParticleEngine2D.h"

class RestingTest : public Test
{
public:
	RestingTest(TestManager* testManager);
	virtual ~RestingTest();

	virtual void Init();
	virtual void Update(float i_elapsedTime);
	virtual void Render(Renderer& renderer) const;
	virtual	void OnKeyPressed(int keyCode);

	void Shoot();
	void ShootTri();

private:
	phynet::phy::ParticleEngine2D m_engine;
	phynet::phy::ParticleGravityFG2D m_gravityFG;

	phynet::Real m_nextParticleSpeed;
	phynet::Real m_nextParticleAngleGrad;
	phynet::Real m_nextParticleDamping;

	static const int NUM_PENDULUM_PARTICLES = 4;
	phynet::phy::Particle2D m_pendulumParticles[NUM_PENDULUM_PARTICLES];
	phynet::phy::ParticleRod2D m_pendulumRods[NUM_PENDULUM_PARTICLES-1];
	phynet::phy::ParticleAnchoredRod2D m_pendulumRodsAncor;
	bool m_pendulumEnabled;

	static const phynet::Real PARTICLE_STARTING_SPEED;
	static const phynet::Real PARTICLE_STARTING_ANGLE_GRAD;
	static const phynet::Real PARTICLE_STARTING_DAMPING;
}; // class SpringTest
